'''
Author: SlytherinGe
LastEditTime: 2021-03-23 11:03:21
'''
# dataset settings
dataset_type = 'VEDAIDatasetMutiChannel'
data_root = '/media/gejunyao/Disk1/Customized Datasets/VEDAI_VOC/'
img_norm_cfg = dict(
    mean=[122.81532489, 123.34766762, 109.80794601, 170.35183843],
    std=[37.03608904, 33.56975757, 34.81962266, 27.46958872], to_rgb=True)
train_pipeline = [
    dict(type='LoadMultiChannelImageFromFiles'),
    dict(type='LoadAnnotations', with_bbox=True),
    dict(type='Resize', img_scale=(1024, 1024), keep_ratio=True),
    dict(type='RandomFlip', flip_ratio=0.5),
    dict(type='Normalize', **img_norm_cfg),
    dict(type='Pad', size_divisor=32),
    dict(type='DefaultFormatBundle'),
    dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']),
]
test_pipeline = [
    dict(type='LoadMultiChannelImageFromFiles'),
    dict(
        type='MultiScaleFlipAug',
        img_scale=(1024, 1024),
        flip=False,
        transforms=[
            dict(type='Resize', keep_ratio=True),
            dict(type='Normalize', **img_norm_cfg),
            dict(type='Pad', size_divisor=32),
            dict(type='ImageToTensor', keys=['img']),
            dict(type='Collect', keys=['img']),
        ])
]
data = dict(
    samples_per_gpu=12,
    workers_per_gpu=16,
    train=dict(
        _delete_=True,
        type='RepeatDataset',
        times=5,
        # type='ClassBalancedDataset', 
        # oversample_thr=1e-3,
        dataset=dict(
            type=dataset_type,
            ann_file=data_root + 'ImageSets/imageset1024/trainval.txt',
            img_prefix=data_root,
            pipeline=train_pipeline)),
    val=dict(
        type=dataset_type,
        ann_file=data_root + 'ImageSets/imageset1024/test.txt',
        img_prefix=data_root,
        pipeline=test_pipeline),
    test=dict(
        type=dataset_type,
        ann_file=data_root + 'ImageSets/imageset1024/test.txt',
        img_prefix=data_root,
        pipeline=test_pipeline))
evaluation = dict(interval=1, metric='mAP')
